package com.kim.openapiclientdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.kim.openapi.KimApn;
import com.kim.openapi.KimOpenApiManager;

public class MainActivity extends AppCompatActivity {

    private KimOpenApiManager sm;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        sm = KimOpenApiManager.register(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    public void click(View view) {
        Log.d("kimkim", "click: ");
        KimApn apn = new KimApn.Builder().setApn("11").createKimAPN();
        if (sm != null) {
            int ret= sm.addApn(apn);
            Log.d("kimkim", "click: ret= "+ret);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        if (sm != null) {
            sm.unRegister();
        }
    }


}
